<?php

use common\helper\StringHelper;
if($model->c_status == 0 && time() > strtotime($model->begin_time) && time() < strtotime($model->end_time) ) {
    echo "<script>alert('过期活动无法再次编辑');window.history.back();</script>";
    exit;
}elseif(time() > strtotime($model->begin_time) && time() < strtotime($model->end_time)) {
    echo "<script>alert('正在进行的活动不能更改');window.history.back();</script>";
    exit;
    
}elseif((strtotime($model->begin_time)-600) < time()) {
    echo "<script>alert('距离活动上线十分钟之前不可更改');window.history.back();</script>";
    exit;
}

$this->title = StringHelper::subtext($model->title, 20);
$this->params['breadcrumbs'][] = ['label' => '促销管理', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => StringHelper::subtext($model->title, 20), 'url' => ['view', 'id' => $model->full_cut_id]];
$this->params['breadcrumbs'][] = 'Update';
?>
<div class="full-cut-update">

    <?= $this->render('_form', [
        'model' => $model,
    ]) ?>

</div>
